package icu.sehnen.controller;


import icu.sehnen.common.CommonResult;
import icu.sehnen.model.Menus;
import icu.sehnen.service.MenusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
public class MenusController {


    @Autowired
    MenusService menusService;

    @GetMapping("/menus")
    public CommonResult getMenus(){
           List<Menus> menuList= menusService.queryMenuList();
           return  CommonResult.success(menuList);
    }

}
